package com.spring.bean.example;

import org.apache.lucene.document.Field.Index;
import org.apache.lucene.document.Field.Store;

import com.spring.annotation.entity.NotPersistent;
import com.spring.annotation.entity.Table;
import com.spring.annotation.search.Searchable;
import com.spring.annotation.search.SearchableComponent;
import com.spring.annotation.search.SearchableId;
import com.spring.annotation.search.SearchableProperty;
import com.spring.bean.Entity;

@Table(name="book") 
@Searchable(name="book")
public class Book extends Entity {
	
	@SearchableId
	private Integer id;
	private Integer sort_id; // 分类id
	@SearchableProperty(index=Index.ANALYZED, store=Store.YES, name="bookName")
	private String name; // 书籍名称
	@SearchableProperty(index=Index.ANALYZED, store=Store.YES)
	private String profile; //简介
	@SearchableProperty(store=Store.YES)
	private String author; // 作者
	@SearchableProperty(store=Store.YES)
	private Double price; // 价格
	private String remark; // 备注
	
	@NotPersistent(fk="sort_id")
	@SearchableComponent(name="com.spring.bean.example.Sort")
	private Sort sort;

	public Integer getId() {
		return id;
	}
	
	public Sort getSort() {
		return sort;
	}

	public void setSort(Sort sort) {
		this.sort = sort;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getSort_id() {
		return sort_id;
	}

	public void setSort_id(Integer sort_id) {
		this.sort_id = sort_id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getProfile() {
		return profile;
	}

	public void setProfile(String profile) {
		this.profile = profile;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}
	
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
